package fr.norsys.mapper.console.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.navigator.menu.MenuRepository;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import fr.norsys.mapper.console.model.Application;
import fr.norsys.mapper.console.model.ConsoleCst;
import fr.norsys.mapper.console.service.ApplicationService;
import fr.norsys.mapper.console.service.LdapTreeBuilder;

public class LdapBrowserAction extends BaseAppDispatchAction {
	private static Log log = LogFactory.getLog(LdapBrowserAction.class);
	private LdapTreeBuilder ldapTreeBuilder;
	private ApplicationService applicationService;

	public ApplicationService getApplicationService() {
		return applicationService;
	}

	public void setApplicationService(ApplicationService applicationService) {
		this.applicationService = applicationService;
	}

	public LdapTreeBuilder getLdapTreeBuilder() {
		return ldapTreeBuilder;
	}

	public void setLdapTreeBuilder(LdapTreeBuilder ldapTreeBuilder) {
		this.ldapTreeBuilder = ldapTreeBuilder;
	}

	public ActionForward build(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		if (log.isDebugEnabled())
			{log.debug("build method called");}
//		String filter = request.getParameter("filter");
//		if(log.isDebugEnabled())
//			{log.debug("filter="+filter);}
//		Application currentAppli = (Application) request.getSession().getAttribute(ConsoleCst.CURRENT_APPLICATION);
//		ldapTreeBuilder.setConnection(currentAppli.getConnection());
		return mapping.findForward("page");
	}
}